package com.example.s05_shop.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "ordersitem")
public class OrdersItem {

    @TableId(value = "id",type = IdType.AUTO)
    int id;
    @TableField(value = "orders_id")
    int ordersId;
    @TableField(value = "product_id")
    int productId;
    @TableField(value = "price")
    BigDecimal price;
    @TableField(value = "count")
    int count;
    @TableField(value = "total_price")
    BigDecimal totalPrice;


    @TableField(exist = false)
    Product product;
}
